﻿
@{
    ViewData["Title"] = "数据挂接";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@section Head{
    <link href="~/layuiadmin/style/style.css" rel="stylesheet" />

    <style>
        .layui-form {
            margin-bottom: 20px;
        }

        .layui-form-item {
            display: inline-block;
        }

            .layui-form-item input {
                height: 30px;
            }

        .layui-form-select {
            width: 140px;
            font-size: 12px;
            display: inline-block;
        }

        .layui-anim-upbit dd {
            font-size: 12px;
        }

        .layui-input-block {
            min-height: 30px;
        }

        .layui-form-label {
            line-height: 11px;
        }

        .layui-form-item input[type='file'] {
            width: 200px;
            border: 1px solid #e5e6e7;
            padding-top: 3px;
            padding-left: 3px;
            box-sizing: border-box;
            font-size: 12px;
        }

        .layui-textarea {
            transition: 0;
            -webkit-transition: all 0s;
            font-size: 12px;
            color: #555;
            height: 400px;
        }

            .layui-textarea:focus {
                border-color: #1ab394 !important;
            }

        .layui-btn-circle {
            width: 30px;
            height: 30px;
            padding: 6px 0;
            border-radius: 15px;
            text-align: center;
            font-size: 12px;
            line-height: 1.428571429;
            border-color: #18a689;
        }

        .layui-btn-primary:hover {
            background-color: #18a689;
            border-color: #18a689;
            color: #fff !important;
        }

            .layui-btn-primary:hover i {
                color: #fff !important;
            }
    </style>
}


<div id="dMain" style="padding:10px;">
    <div class="layui-row">
        <div class="layui-card">
            <div class="layui-card-header">
                数据挂接(条目数据)
                <a href="../Help.cshtml" target="_blank" class="layui-btn-circle layui-btn layui-btn-primary layui-btn-sm" style="float: right;margin-top: 6px;">
                    <i class="layui-icon layui-icon-help" style="line-height: 18px;margin-right: 7px;color: #18a689;font-weight: initial;"></i>
                </a>
            </div>
            <div class="layui-card-body">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label>选择模板:</label>
                        <select name="interest" lay-filter="ddlexcel" id="ddlexcel">
                            <option value="诉讼档案案卷目录">诉讼档案案卷目录</option>
                            <option value="诉讼档案卷内目录">诉讼档案卷内目录</option>
                            <option value="传统文书案卷目录">传统文书案卷目录</option>
                            <option value="传统文书卷内目录">传统文书卷内目录</option>
                            <option value="简化文书案卷目录">简化文书案卷目录</option>
                            <option value="基建档案案卷目录">基建档案案卷目录</option>
                            <option value="基建档案卷内目录">基建档案卷内目录</option>
                            <option value="工程项目案卷目录">工程项目案卷目录</option>
                            <option value="工程项目卷内目录">工程项目卷内目录</option>
                            <option value="设备档案案卷目录">设备档案案卷目录</option>
                            <option value="设备档案卷内目录">设备档案卷内目录</option>
                            <option value="录音档案案卷目录">录音档案案卷目录</option>
                            <option value="照片档案案卷目录">照片档案案卷目录</option>
                            <option value="照片档案卷内目录">照片档案卷内目录</option>
                            <option value="光盘档案案卷目录">光盘档案案卷目录</option>
                            <option value="电子文件案卷目录">电子文件案卷目录</option>
                            <option value="技术档案案卷目录">技术档案案卷目录</option>
                            <option value="会计档案案卷目录">会计档案案卷目录</option>
                            <option value="实物档案案卷目录">实物档案案卷目录</option>
                        </select>
                        <a class="layui-btn layui-btn-sm" style="margin-top: -3px;" id="btnDownload" onclick="btnDownloadClick()">下载</a>
                    </div>

                    <div class="layui-form-item" style="width: 44%;text-align: center;">
                        <label>选择Excel:</label>
                        <!--<button type="button" class="layui-btn layui-btn-sm" id="test3" style="margin-top: -3px;"><i class="layui-icon"></i>上传文件</button>-->
                        <input type="file" name="file" id="SelectExcel">
                        <a class="layui-btn layui-btn-sm" style="margin-top: -3px;">条目导入</a>
                    </div>

                    <div class="layui-form-item">
                        <label>选择ZIP压缩包:</label>
                        <!--<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" id="test4"><i class="layui-icon"></i>只允许压缩文件</button>-->
                        <input type="file" name="file" id="SelectZip">
                        <a class="layui-btn layui-btn-sm" style="margin-top: -3px;">图片上传</a>
                    </div>
                </div>
                <div style="text-align: center; color: red; line-height: 30px;">选择需要的模板进行下载，然后编辑上传。上传时，文件名不可进行修改，格式为：XXXXXX目录.xls，模板内红色栏位为必填字段，上传zip文件大小不得超过500MB</div>
                <div><hr style="height: 1px; border: none; border-top: 1px dashed #1E90FF; margin-top: 3px; margin-bottom: 5px;"></div>
                <div style="height: 30px;"></div>
                <textarea class="layui-textarea" name="txtMsg" id="txtMsg" rows="2" cols="20"></textarea>
            </div>
        </div>
    </div>
</div>

<script>
    window.onload = function () {
        layui.use('form', function () {
            var form = layui.form;
        })

        //Xls Excel文件
        layui.use('upload', function () {
            var $ = layui.jquery
                , upload = layui.upload;

            upload.render({ //允许上传的文件后缀
                elem: '#SelectExcel'
                , url: ''
                , accept: 'file' //普通文件
                , exts: 'xls' //只允许上传Excel文件
                , done: function (res) {
                    console.log(res)
                }
            });
        })

        //Zip压缩文件
        layui.use('upload', function () {
            var $ = layui.jquery
                , upload = layui.upload;

            upload.render({ //允许上传的文件后缀
                elem: '#SelectZip'
                , url: ''
                , accept: 'file' //普通文件
                , size: 512000   //限制上传大小，500M
                , exts: 'zip' //只允许上传压缩文件
                , done: function (res) {
                    console.log(res)
                }
            });
        })

        function btnDownloadClick() {
            //              var fileName = $("#ddlexcel").select().val();
            //              location.href = "/DataImport/ExcelTemplate/" + fileName + ".xls";
        }
    }
</script>